﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OutdoorLib.BaseEntity.Contract;
using Grishko.DataTier;
using Grishko.UI;
using OutdoorLib.BaseEntity.Constraction;
using System.IO;

public partial class Ctl_ctlSideSheduleRows : System.Web.UI.UserControl
{    

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    #region Public 
    public IListOfFilter ImListOfFilter
    {
        get { return ctlSideSheduleTable; }
    }
    
    public Grishko.UI.SideSheduleTable.SideSheduleParams SheduleParams
    {
        get { return ctlSideSheduleTable.SheduleTimeParam; }
        set { ctlSideSheduleTable.SheduleTimeParam = value; }
    }
    #endregion

    #region ScriptInclude
        protected string ScriptInclude_CurrentContract {get{return (null==SheduleParams.CurrentContract?String .Empty : SheduleParams.CurrentContract.ID) ; } }
        protected string ScriptInclude_dtStart {get{return SheduleParams.dtStart .ToShortDateString () ; } }
        protected string ScriptInclude_dtFinish {get{return SheduleParams.dtFinish.ToShortDateString () ; } }
        protected string ScriptInclude_TimaPeriodID { get { return SheduleParams.Period.ToString (); } }                
    #endregion

        protected override void OnPreRender(EventArgs e)
        {
            string script=RefreshRowParam.GetImAsJavaScriptValue(ScriptInclude_CurrentContract,
                                                    string.Empty,
                                                    string.Empty,
                                                    ScriptInclude_dtStart,
                                                    ScriptInclude_dtFinish,
                                                    ScriptInclude_TimaPeriodID);
         
        
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script, true);
         base.OnPreRender(e);
        }


    
}
